home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 147 < prev    next >
Text File  |  1996-08-06  |  2KB  |  40 lines

  1. Path: gabi-soft.fr!usenet
  2. From: kanze@gabi.gabi-soft.fr (J. Kanze)
  3. Newsgroups: comp.std.c
  4. Subject: Re: atexit() and return from main()
  5. Date: 19 Jan 1996 11:49:45 GMT
  6. Organization: GABI Software, Sarl.
  7. Message-ID: <KANZE.96Jan19124945@gabi.gabi-soft.fr>
  8. References: <4dhfja$j50@fg70.rz.uni-karlsruhe.de> <4diicg$i9e@lyra.csx.cam.ac.uk>
  9.     <821923074snz@genesis.demon.co.uk> <4dkvjk$6q5@lyra.csx.cam.ac.uk>
  10. NNTP-Posting-Host: gabi.gabi-soft.fr
  11. In-reply-to: nmm1@cus.cam.ac.uk's message of 18 Jan 1996 08:15:48 GMT
  12.  
  13. In article <4dkvjk$6q5@lyra.csx.cam.ac.uk> nmm1@cus.cam.ac.uk (Nick
  14. Maclaren) writes:
  15.  
  16.     [...]
  17. > However, for the advanced paper, think about the following problems:
  18. > What is the effect of an atexit() function calling exit()?  Does it
  19. > restart the atexit() queue, carry on as if the function had returned
  20. > or does it abandon the atexit() queue?
  21. > I chose to do the second, as by far the most user-friendly, but I
  22. > would NEVER write serious code that relied upon that action!
  23. > main() calls setjmp() and then calls exit().  An atexit() function
  24. > calls longjmp() and returns to main().  This repeats (or does it?)
  25. > This is ALSO permitted by omission, but a good run-time system will
  26. > trap it, issue an error message and stop without calling more atexit()
  27. > functions.
  28.  
  29. According to ISO 9899: "If more than one call to the exit function is
  30. executed by a program, the behavior is undefined."
  31. -- 
  32. James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
  33. GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
  34. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  35.               -- A la recherche d'une activitΘ dans une region francophone
  36.